dataSource {
    pooled = true
	
	//MySQL
	/*
    driverClassName = "com.mysql.jdbc.Driver" 	
    username = "root" 
    password = "al" 
	dialect = "org.hibernate.dialect.MySQL5InnoDBDialect"
	*/
	
	//Memoria	
	
	driverClassName = "org.h2.Driver"
	username = "sa"
	password = ""
	
	
	//SQL SERVER
	/*
	driverClassName = "com.microsoft.sqlserver.jdbc.SQLServerDriver" 
	dialect = "org.hibernate.dialect.SQLServerDialect"	
	username = "sa"
	password = "al"
	*/
}

hibernate {
    cache.use_second_level_cache = true
    cache.use_query_cache = true
    cache.region.factory_class = 'net.sf.ehcache.hibernate.EhCacheRegionFactory'
}
// environment specific settings
environments {
    development {
        dataSource {
            //dbCreate = "create-drop" // one of 'create', 'create-drop', 'update', 'validate', ''
			
			dbCreate = "create-drop"
			//dbCreate = "update" 
			url = "jdbc:h2:mem:devDb;MVCC=TRUE;LOCK_TIMEOUT=10000"
			
			//url = "jdbc:mysql://localhost/photo_admin"
			
			//SQL Server
			//url = "jdbc:sqlserver://localhost:1433;databaseName=photoAdmin"
			
        }
    }
    test {
        /*dataSource {
            dbCreate = "update"
            url = "jdbc:h2:mem:testDb;MVCC=TRUE"
        }*/
		dataSource {
			dbCreate = "update"
			url = "jdbc:h2:prodDb;MVCC=TRUE"
			pooled = true
			properties {
			   maxActive = -1
			   minEvictableIdleTimeMillis=1800000
			   timeBetweenEvictionRunsMillis=1800000
			   numTestsPerEvictionRun=3
			   testOnBorrow=true
			   testWhileIdle=true
			   testOnReturn=true
			   validationQuery="SELECT 1"
			}
		}	
    }
    production {
        dataSource {
            dbCreate = "update"
            url = "jdbc:h2:file:/usr/local/tomcat/prodDb;MVCC=TRUE"
            pooled = true
            properties {
               maxActive = -1
               minEvictableIdleTimeMillis=1800000
               timeBetweenEvictionRunsMillis=1800000
               numTestsPerEvictionRun=3
               testOnBorrow=true
               testWhileIdle=true
               testOnReturn=true
               validationQuery="SELECT 1"
            }
        }
    }
}
